function EFFECT:Init(data)

	self.Origin = data:GetEntity():GetPos()
	self.End = data:GetOrigin()
	self.ColorData = data:GetStart()
	self.Radius = data:GetRadius()
	self.LifeTime = data:GetNormal().x
	self.StartAlpha = data:GetNormal().y
	self.BeamMode = data:GetScale()
	
	if (self.BeamMode == 1) then
		self.Mat = Material("CDE/beam_thin")
	elseif (self.BeamMode == 2) then
		self.Mat = Material("CDE/beam_thick")
	elseif (self.BeamMode == 3) then
		self.Mat = Material("CDE/Distort")
	end
	
	self.Size = self.StartAlpha
	
	self.GenTime = CurTime()
	
	self.Color = Color(self.ColorData.x, self.ColorData.y, self.ColorData.z, self.StartAlpha * 255)
	
	self.Entity:SetRenderBoundsWS( self.Origin, self.End )
end

/*---------------------------------------------------------
   THINK
---------------------------------------------------------*/
function EFFECT:Think()
	if ((self.GenTime + self.LifeTime) < CurTime()) then
		return false
	else
		self.Size = math.Clamp(1 - ((CurTime() - self.GenTime) / self.LifeTime), 0, 1)
		self.Color = Color(self.ColorData.x, self.ColorData.y, self.ColorData.z, (self.StartAlpha * 255))
		return true
	end
end

/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render()
			
	render.SetMaterial(self.Mat)
	render.DrawBeam(self.Origin, self.End, self.Radius * self.Size, 1, 1, self.Color)
					 
end
